package com.qianfeng.openapi.web.master.controller;

import com.alibaba.fastjson.JSONObject;
import com.qianfeng.openapi.web.master.dto.TableData;
import com.qianfeng.openapi.web.master.dto.TableParam;
import com.qianfeng.openapi.web.master.feign.SearchServiceClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/12/30
 * @Time: 下午3:59
 */
@RestController
public class SearchLogController {

    @Resource
    private SearchServiceClient searchServiceClient;

    @RequestMapping("/search/log/list")
    public TableData logList(TableParam param){

        JSONObject json = new JSONObject();
        json.put("requestContent","海尔");


        List<Map> list = searchServiceClient.searchLog(json.toJSONString());
        long total = searchServiceClient.count(json.toJSONString());


        TableData data = new TableData();
        data.setRows(list);
        data.setTotal(total);

        return  data;
    }


}
